package com.itheima.mapper.system;

import com.itheima.domain.system.SysLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SysLogMapper {

    @Select("select * from syslog order by visitTime desc")
    List<SysLog> findAll();


    @Insert("insert into syslog(id,visitTime,username,ip,url,executionTime,method)" +
            "values(#{id},#{visitTime},#{username},#{ip},#{url},#{executionTime},#{method})")
    void save(SysLog sysLog);


    @Delete("delete from syslog where id=#{id}")
    void delete(String id);

    @Select("select * from syslog where username like '%${value}%'")
    List<SysLog> findByUsername(String username);
}
